import type { RouteStandard } from "@/types/route"
import Layout from "@/view/Layout/index.vue"

/*
meta的相关属性
title: 'title'            设置该路由在侧边栏和面包屑中展示的名字
icon: 'svg-name'          设置该路由的图标
breadcrumb: false         如果设置为false，则不会在breadcrumb面包屑中显示(默认 true)
hidden: true              当设置 true 的时候该路由不会再侧边栏出现 如404，login等页面(默认 false)
tabsRemove:false          设置该路由的标签页是否能被删除(默认 true)
*/

const systemRoutes:RouteStandard[]=[
  {
    path:'user',
    name:'User',
    component:()=>import('@/view/User/index.vue'),
    meta:{
      title:'用户管理',
      icon:'UserFilled'
    },
  }
]

const routes:RouteStandard[] = [
  {
    path:'/',
    name:'',
    meta:{},
    redirect:'/home'
  },
  {
    path:'/home',
    name:'Home',
    component:Layout,
    meta:{},
    children:[
      {
        path:'',
        name:'HomeIndex',
        component:()=>import('@/view/Home/index.vue'),
        meta:{
          title:'主页',
          icon:'house',
          tabsRemove:false
        }
      }
    ]
  },
  {
    path:'/system',
    name:'System',
    component:Layout,
    meta:{
      title:'系统管理',
      icon:'setting'
    },
    children:systemRoutes
  }
]

export default routes